<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class Auth {

    function logged_in() {
        $CI = & get_instance();
        $CI->load->library('session');
        if ($CI->session->userdata('user_authentication') || $CI->session->userdata('user')) {
            $session_data = $CI->session->userdata('user_authentication');
        } else {
           echo "<script>window.location = '".base_url()."';</script>";
        }
    }
    
    function user_logged_in()
    {
        $CI = & get_instance();
        $CI->load->library('session');
        if ($CI->session->userdata('user')) {
            $session_data = $CI->session->userdata('user');
        } else {
            
            redirect(site_url(''));
        }
    }

}

